package com.robot.admin.pojo.client;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * settlementDetails实体类
 *
 * @author wuyunbin
 */
@Entity
@Table(name = "settlement_details")
public class SettlementDetails implements Serializable {

    /**
     * 结算明细id
     */
    @Id
    private String id;


    /**
     * 代理商id
     */
    private String agentId;
    /**
     * 会员id
     */
    private String memberId;
    /**
     * 商家id
     */
    private String companyId;
    /**
     * 店铺id
     */
    private String storeId;
    /**
     * 会员等级
     */
    private String memberGrade;
    /**
     * 小票金额
     */
    private BigDecimal price;
    /**
     * rate
     */
    private Double rate;
    /**
     * 折扣金额
     */
    private BigDecimal discountAmount;
    /**
     * 实付金额
     */
    private BigDecimal payAmount;
    /**
     * 总收益
     */
    private BigDecimal totalRevenue;
    /**
     * 代理商收益
     */
    private BigDecimal agentRevenue;
    /**
     * 平台收益
     */
    private BigDecimal revenue;
    /**
     * 本金
     */
    private BigDecimal principal;
    /**
     * 会长提成
     */
    private BigDecimal royalty;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    /**
     * 最后更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
    /**
     * 删除时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deletedAt;

    public SettlementDetails() {
    }

    public SettlementDetails(String agentId, String memberId, String companyId) {
        this.agentId = agentId;
        this.memberId = memberId;
        this.companyId = companyId;
    }

    public SettlementDetails(String agentId, String memberId, String companyId, String storeId, String memberGrade, BigDecimal price, Double rate, BigDecimal discountAmount, BigDecimal payAmount, BigDecimal totalRevenue, BigDecimal agentRevenue, BigDecimal revenue, BigDecimal principal, BigDecimal royalty, LocalDateTime createdAt, LocalDateTime updatedAt) {
        this.agentId = agentId;
        this.memberId = memberId;
        this.companyId = companyId;
        this.storeId = storeId;
        this.memberGrade = memberGrade;
        this.price = price;
        this.rate = rate;
        this.discountAmount = discountAmount;
        this.payAmount = payAmount;
        this.totalRevenue = totalRevenue;
        this.agentRevenue = agentRevenue;
        this.revenue = revenue;
        this.principal = principal;
        this.royalty = royalty;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getMemberGrade() {
        return memberGrade;
    }

    public void setMemberGrade(String memberGrade) {
        this.memberGrade = memberGrade;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    public BigDecimal getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) {
        this.discountAmount = discountAmount;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public BigDecimal getTotalRevenue() {
        return totalRevenue;
    }

    public void setTotalRevenue(BigDecimal totalRevenue) {
        this.totalRevenue = totalRevenue;
    }

    public BigDecimal getAgentRevenue() {
        return agentRevenue;
    }

    public void setAgentRevenue(BigDecimal agentRevenue) {
        this.agentRevenue = agentRevenue;
    }

    public BigDecimal getRevenue() {
        return revenue;
    }

    public void setRevenue(BigDecimal revenue) {
        this.revenue = revenue;
    }

    public BigDecimal getPrincipal() {
        return principal;
    }

    public void setPrincipal(BigDecimal principal) {
        this.principal = principal;
    }

    public BigDecimal getRoyalty() {
        return royalty;
    }

    public void setRoyalty(BigDecimal royalty) {
        this.royalty = royalty;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public LocalDateTime getDeletedAt() {
        return deletedAt;
    }

    public void setDeletedAt(LocalDateTime deletedAt) {
        this.deletedAt = deletedAt;
    }

    @Override
    public String toString() {
        return "SettlementDetails{" +
                "id='" + id + '\'' +
                ", agentId='" + agentId + '\'' +
                ", memberId='" + memberId + '\'' +
                ", companyId='" + companyId + '\'' +
                ", storeId='" + storeId + '\'' +
                ", memberGrade='" + memberGrade + '\'' +
                ", price=" + price +
                ", rate=" + rate +
                ", discountAmount=" + discountAmount +
                ", payAmount=" + payAmount +
                ", totalRevenue=" + totalRevenue +
                ", agentRevenue=" + agentRevenue +
                ", revenue=" + revenue +
                ", principal=" + principal +
                ", royalty=" + royalty +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                ", deletedAt=" + deletedAt +
                '}';
    }
}
